#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_accept_clicked()
{
    ui->label->setText("贤妻扶我青云志，我还贤妻万两金");
    ui->pushButton_reject->setEnabled(false);
}

void Widget::on_pushButton_reject_clicked()
{
//    srand(time(nullptr));
//    int width = this->geometry().width();
//    int height = this->geometry().height();

//    int x = rand() % width;
//    int y = rand() % height;

//    ui->pushButton_reject->move(x, y);
}

void Widget::on_pushButton_reject_pressed()
{
        srand(time(nullptr));
        int width = this->geometry().width();
        int height = this->geometry().height();

        int x = rand() % width;
        int y = rand() % height;

        ui->pushButton_reject->move(x, y);
}
